<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 85167
  Date: 2017/12/10
  Time: 11:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>字典类型管理</title>
    <c:import url="/WEB-INF/page/header.jsp"/>
</head>
<body>
<h4 class="m-t"></h4>
<div class="col-sm-12">
    <!-- Example Toolbar -->
    <div class="example-wrap">
        <div class="panel panel-default">
            <div class="panel-heading"><b>IMEI管理</b></div>
            <div class="panel-body">
                <form id="formSearch" class="form-inline">
                    <div class="form-group">
                        <span>imei：</span>
                        <input type="text" class="form-control" id="imei">
                        <span>设备ID：</span>
                        <input type="text" class="form-control" id="devId">
                    </div>
                </form>
            </div>
        </div>
        <div class="example">
            <div class="hidden-xs" id="dataTableToolbar" role="group">
                <div class="pull-left" style="margin-bottom: 8px;">
                    <button type="button" class="btn btn-white btn-sm"
                            onclick="javascript: $('#dataTable').bootstrapTable('refresh');">
                        <i class="glyphicon glyphicon-repeat">&nbsp;刷新</i>
                    </button>
                </div>
                <div class="pull-right">
                    <button type="button" id="btn_query"
                            class="btn btn-primary btn-rounded btn-outline btn-sm "
                            onclick="javascript: $('#dataTable').bootstrapTable('refresh');">
                        <i class="fa fa-search"></i>查询
                    </button>
                </div>
            </div>
            <table id="dataTable">
            </table>
        </div>
    </div>
    <!-- End Example Toolbar -->
</div>
<c:import url="/WEB-INF/page/footer.jsp"/>
<script type="text/javascript">
    // Example Bootstrap Table Toolbar
    // -------------------------------
    (function () {
        $('#dataTable').bootstrapTable({
            url: base + "/admin/biz/imeiIcCid/list",
            method: "post",
            queryParams: function (params) {
                var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    limit: params.limit,   //页面大小
                    offset: params.offset,  //页码icCid
                    imei: $("#imei").val(),
                    devId: $("#devId").val(),
                };
                return temp;
            },
            toolbar: '#dataTableToolbar',
            pagination: true,
            sidePagination: "server",
            columns: [{
                checkbox: true
            }, {
                field: 'imei',
                title: 'imei'
            }, {
                field: 'devId',
                title: '设备ID'
            }, {
                field: 'icCid',
                title: 'icCid'
            }, {
                field: 'createTime',
                title: '更新时间',
                formatter:function (value,row,index) {
                    var date =  new Date(value);
                    var y = 1900+date.getYear();
                    var m = "0"+(date.getMonth()+1);
                    var d = "0"+date.getDate();
                    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
                }
            }]
        });
    })();

    function delRow(id) {
        swal({
            title: "您确定要删除这条信息吗",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            cancelButtonText: "取消",
            closeOnConfirm: false
        }, function () {
            delData(base + "/admin/biz/repairInfo/delete?id=" + id);
        });
    }

    function view(id) {
        openDialogView("查看报修信息", base + "/admin/biz/repairInfo/view?id=" + id);
    }

    function chgStatus(id, status) {
        doChgStatus(base + "/admin/biz/repairInfo/chgStatus?id=" + id + "&status=" + status);
    }

</script>
</body>
</html>
